	<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/resource/UserPwoer.tld" prefix="p"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("fnId", request.getAttribute("fnId"));
	pageContext.setAttribute("userPwoer", request.getSession().getAttribute("userPwoer"));
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
</head>
<body class="gray-bg">
	<nav class="huiNav">
		<i class="fa fa-home"></i> 首页 <span>&gt;</span>个人中心<span>&gt;</span>异常处理
		<a class="btn btn-info  btn-sm pull-right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="fa fa-refresh"></i></a>
	</nav>

	<div class="ibox-content">
	<!-- 搜索框部分start -->
	<p:btn value="serch">
		<form class="form-inline" id="serchform">
			
			<div class="form-group mr-20">
				<label for="exampleInputName2">项目名称</label>
				<input name="projName" type="text" class="form-control">
			</div>
			<div class="form-group mr-20">
				<label for="exampleInputName2">异常类型</label>
				<input name="exceptionType" type="text" class="form-control">
			</div>
			
			<div class="form-group mr-20">
				<label for="exampleInputName2">处理人</label>
				<input name="doneMan" type="text" class="form-control">
			</div>
			<div class="form-group mr-20">
				<label for="exampleInputName2">异常描述</label>
				<input name="errorMsg" type="text" class="form-control">
			</div>
			<div class="form-group mr-20">
						<label class="col-sm-2 control-label">创建日期</label> <input
							name="beginTime" type="text" placeholder="开始时间"
							class="form-control datetimepicker" id="beginTime"> <input
							placeholder="结束时间" name="endTime" type="text"
							class="form-control datetimepicker" id="endTime">
			</div>
			<button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search " ></i> 搜索</button>
			<button  type="reset" class="btn btn-info btn-sm"><i c·lass="fa fa-refresh " ></i> 重置</button>
		</form>
		
		</p:btn>
	<!-- 搜索框部分en -->
		<div class="option-bar" >
			<button onclick="myGrid.delItems()" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i>批量删除</button>
		</div>
		<table id="mgrid" >
			<thead>
				<tr>
					<th data-checkbox="true"  ></th>
					<th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th>
					<th data-field="exceptionType" >类型</th>
					<th data-field="simpleMsg" >描述</th>
					<th data-field="projName" >项目</th>
					<th data-field="machine" >机器名称</th>
					<th data-field="mdc" >追踪码</th>
					<th data-field="doneMan" >处理人</th>
					<th data-field="createTime" data-formatter="MGrid.getTime" data-sortable="true" >发生时间</th>
					<th data-field="doneTime" data-formatter="MGrid.getTime" data-sortable="true" >处理时间</th>
					<th data-align="center"  data-width="150px" data-field="id" data-formatter="buidOperate">操作</th>
				</tr>
			</thead>
		</table>
	</div>
	
	<script type="text/javascript">
	var myGrid;
		$(function(){
			 myGrid=MGrid.initGrid({
				 url:"${path}/admin/showException",
				 delUrl:"${path}/admin/delException"
				 
			 });
			 
			 var _initParam = {
						format : 'yyyy-mm-dd hh:ii',
						todayBtn : true,
						autoclose : true,
						startView : 2,
						maxView : 3,
						minView : 0
					};
					MTools.ininDatetimepicker(_initParam);
					//限制结束时间不小于开始时间
					var initParam = {
						format : 'yyyy-mm-dd hh:ii',
						todayBtn : true,
						autoclose : true,
						startView : 2,
						maxView : 3,
						minView : 0
					};
					MTools.limitStartEndTime(initParam);
					
		});
		
		
		function buidOperate(value, row, index){
			var html='';
			html+='<a    class="btn btn-default btn-sm mr-5" href="${path}/showExcptionUrl?id=' + value+'" target="_blank" >查看</a>';
			html+='<button class="btn btn-default btn-sm mr-5" onClick="myGrid.delItem('+value+')" title="删除"><i class="fa fa-lg fa-trash-o"></i></buttoun>';
			return html;  
		}
	 
		function openEdit(id) {
			window.top.location.href= '${path}/showExcptionUrl?id=' + id;
		}
	 
	</script>
</body>
</html>
